<?php
namespace Home\Controller;
use Home\Model\asdfgModel;
use Home\Model\IkhdModel;
use Home\Model\OredsModel;
use Home\Model\RegModel;
use Think\Controller;
class RegController extends Controller {
    //注册
    public function index(){
        if (IS_GET) {
            $this->display();
            return;
        }
        $Login = new RegModel();
        $data = $Login->Reg();

        if(empty($data)){
            $this->ajaxReturn(array('status'=>false,'error'=>$Login->getError()));
            return;
        }
        $this->ajaxReturn(array('status'=>true));
        return;
    }
    //添加收货地址
    public function orders(){
        if (IS_GET) {
            $this->display();
            return;
        }
        $oreds = new OredsModel();
        $data = $oreds->order();
        if(empty($data)){
            $this->ajaxReturn(array('status'=>false,'error'=>$oreds->getError()));
            return;
        }
        $this->ajaxReturn(array('status'=>true));
        return;
    }
    public function ikhd(){
        if (IS_GET) {
            $this->display();
            return;
        }
        $il = new IkhdModel();
        $ils = $il->jine();
        if(empty($ils)){
            $this->ajaxReturn(array('status'=>false,'error'=>$il->getError()));
            return;
        }
        $this->ajaxReturn(array('status'=>true));
        return;
    }
    public function asdrgv(){
        if (IS_GET) {
            $this->display();
            return;
        }
        $il = new asdfgModel();
        $ils = $il->chongzi();
        if(empty($ils)){
            $this->ajaxReturn(array('status'=>false,'error'=>$il->getError()));
            return;
        }
        $this->ajaxReturn(array('status'=>true));
        return;
    }

}